<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="text">
</body>

</html>
<script>
    const inpEle = document.querySelector('input')

    function fn() {
        console.log('糟了，我被触发了，快关闭我');
    }
    function ddd(sss, aaa) {
        let timerid = null;
        return function () {
            if (timerid) {
                clearTimeout(timerid)
            } 
                timerid = setTimeout(() => {
                    sss()
                }, aaa)
            
        }
    }
    inpEle.oninput = ddd(fn, 1000)
</script>